#!/bin/sh

# path to scripts for sind service
INITDIR="/etc/init.d"
RC_DIR="/etc/rc.d"

if [ $# -eq 0 ]; then
   echo "Usage:"
   echo "      service <type> <args>"
   exit 1
fi

if [ "$1" = "list" ]; then
  ls $INITDIR/
  ls $RC_DIR/
  exit 1;
fi

if [ -x "$INITDIR/$1" ]; then
    # include kernel config
    . /etc/scripts/config.sh

    # include profile variables
    . /etc/profile

    ($RC_DIR/*"$1" "$2" 2>&1)
else
    echo "No such Service: $1 in $INITDIR";
    exit 1
fi

exit 0
